<?php
/**
 * Created by PhpStorm.
 * User: jwb
 * Date: 2021/4/28
 * Time: 15:55
 */

namespace App\Inventor\Selectable;


use App\Patent;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Grid;
use Encore\Admin\Grid\Selectable;

class PatentSelectable extends Selectable
{
    public $model = Patent::class;

    public function make()
    {
        $admin = Admin::user();
        $this->filter(function(Grid\Filter $filter){
            $filter->disableIdFilter();
            $filter->like('patent_name','专利名称');
            $filter->like('patent_sn','专利号');
        });
        $this->model()->where('user_id',$admin->id)->where('state', 1);
        $this->column('patent_sn', '专利号');
        $this->column('patent_name', '专利名称');
        $this->column('legal_status', '法律状态');
        $this->setView('component.grid.table');
    }


}